import request from '@/utils/request'

// import request from '@/api/system/apis.js'

// 获取部门页面
export function department (query) {
  return request({
    url: '/system/department/tree',
    method: 'post',
    params: query
  })
}
// 获取部门选择
export function departmentlist (query) {
  return request({
    url: '/system/department/list',
    method: 'post',
    params: query
  })
}

// 获取职工类型
export function workTypeAll (query) {
  return request({
    url: '/system/resourceType/findListWorkType',
    method: 'get',
    params: query
  })
}
// 获取职工详情
export function editsave(query) {
  return request({
    url: `/system/resource/findById?idx=${query}`,
    method: 'get',
    params: query
  })
}

// 职工新增保存
export function resourcesave (data) {
  return request({
    url: '/system/resource/save',
    method: 'post',
    data: data
  })
}

// 职工分页查询
export function findPageStaff (query) {
  return request({
    url: '/system/resource/findPageStaff',
    method: 'get',
    params: query
  })
}
// 职工删除
export function resourcedelete (data) {
  return request({
    url: '/system/resource/delete',
    method: 'post',
    data: data
  })
}
// 物料分页查询
export function materialfindPage (query) {
  return request({
    url: '/system/material/findPage',
    method: 'get',
    params: query
  })
}
// 获取物料类型
export function findListMaterialType (query) {
  return request({
    url: '/system/resourceType/findListMaterialType',
    method: 'get',
    params: query
  })
}

// 物料新增
export function materialsave (data) {
  return request({
    url: '/system/material/save',
    method: 'post',
    data: data
  })
}
// 物料删除
export function materialdelete (data) {
  return request({
    url: '/system/material/delete',
    method: 'post',
    data: data
  })
}

// 车辆分页查询
export function carfindPage (query) {
  return request({
    url: '/system/car/findPage',
    method: 'get',
    params: query
  })
}
// 车辆新增保存
export function carsave (data) {
  return request({
    url: '/system/car/save',
    method: 'post',
    data: data
  })
}

// 获取车辆类型
export function findListCarType (query) {
  return request({
    url: '/system/resourceType/findListCarType',
    method: 'get',
    params: query
  })
}
// 车辆删除
export function cardelete (data) {
  return request({
    url: '/system/car/delete',
    method: 'post',
    data: data
  })
}

// 职工类型分页查询
export function resourceTypefindPage (data) {
  return request({
    url: '/system/resourceType/findPage',
    method: 'post',
    data: data
  })
}

// 职工类型新增
export function resourceTypesave (data) {
  return request({
    url: '/system/resourceType/save',
    method: 'post',
    data: data
  })
}
// 工种删除
export function resourceTypedelete (data) {
  return request({
    url: '/system/resourceType/delete',
    method: 'post',
    data: data
  })
}

//紧急呼叫
export function emergencyCall (data) {
  return request({
    url: '/socket/display/sendMessages',
    method: 'post',
    data: data
  })
}
